/* Networks Page Specific Styles - Podman Desktop inspired */

.networks-page {
  padding: 24px;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Network Container */
.network-container {
  display: grid;
  gap: 16px;
  width: 100%;
}

.network-container.grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.network-container.list {
  grid-template-columns: 1fr;
}

/* Network Card */
.network-card {
  background-color: var(--dark-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  position: relative;
}

.network-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.network-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(189, 147, 249, 0.3);
}

/* Network Selection */
.network-selection {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
}

.network-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Network Header */
.network-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-left: 24px; /* Space for checkbox */
}

.network-info {
  flex: 1;
  min-width: 0;
}

.network-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.network-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--light-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-meta {
  margin-top: 4px;
}

.network-type {
  font-size: 12px;
  color: var(--gray-text);
  background-color: var(--current-line);
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.network-actions {
  display: flex;
  gap: 8px;
}

/* Network Body */
.network-body {
  margin-bottom: 16px;
  padding-left: 24px; /* Space for checkbox */
}

.network-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-label {
  font-size: 12px;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  font-size: 14px;
  color: var(--light-text);
  font-weight: 500;
}

/* Autostart Indicator */
.autostart-indicator {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.autostart-indicator.enabled {
  background-color: rgba(80, 250, 123, 0.2);
  color: var(--success-color);
}

.autostart-indicator.disabled {
  background-color: rgba(98, 114, 164, 0.2);
  color: var(--gray-text);
}

/* Network Footer */
.network-footer {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  padding-left: 24px; /* Space for checkbox */
}

.network-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--current-line);
  color: var(--light-text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.network-footer button.primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--background);
}

.network-footer button.warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: var(--background);
}

.network-footer button.danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: var(--background);
}

.network-footer button.secondary {
  background-color: var(--current-line);
  border-color: var(--border-color);
  color: var(--light-text);
}

.network-footer button:hover {
  opacity: 0.9;
}

/* Form Styles for Network Creation */
.ip-config-group,
.dhcp-range-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.range-separator {
  text-align: center;
  color: var(--gray-text);
  font-size: 14px;
}

/* Bulk Selection Bar */
.bulk-selection-bar {
  grid-column: 1 / -1;
  background-color: var(--current-line);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.selection-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selection-count {
  font-weight: 600;
  color: var(--primary-color);
}

.bulk-actions {
  display: flex;
  gap: 12px;
}

.bulk-actions button {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--current-line);
  color: var(--light-text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
}

.bulk-actions button.danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: var(--background);
}

.bulk-actions button.secondary {
  background-color: var(--current-line);
  border-color: var(--border-color);
  color: var(--light-text);
}

.bulk-actions button:hover {
  opacity: 0.9;
}

/* Header Controls */
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-group,
.filter-group,
.view-toggle,
.bulk-group {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--current-line);
  color: var(--light-text);
  font-size: 14px;
  min-width: 200px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(189, 147, 249, 0.2);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--current-line);
  color: var(--light-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--current-line);
  color: var(--gray-text);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  min-width: 36px;
}

.view-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--background);
}

.view-btn:hover:not(.active) {
  background-color: var(--background);
  color: var(--light-text);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .network-container.grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .networks-page {
    padding: 16px;
  }

  .network-container.grid {
    grid-template-columns: 1fr;
  }

  .network-header,
  .network-body {
    padding-left: 20px; /* Smaller space for checkbox */
  }

  .network-footer {
    padding-left: 20px;
    flex-direction: column;
  }

  .ip-config-group,
  .dhcp-range-group {
    grid-template-columns: 1fr;
  }

  .bulk-selection-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .bulk-actions {
    justify-content: center;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .view-toggle {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .network-card {
    padding: 16px;
  }

  .network-header,
  .network-body {
    padding-left: 16px;
  }

  .network-footer {
    padding-left: 16px;
    gap: 8px;
  }

  .network-footer button {
    padding: 6px 12px;
    font-size: 13px;
  }

  .network-selection {
    top: 8px;
    left: 8px;
  }

  .network-checkbox {
    width: 16px;
    height: 16px;
  }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: light) {
  .network-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .network-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }
}